<%--
    Document   : index
    Created on : Sep 9, 2012, 4:27:25 PM
    Author     : W4L3
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="ca.trader.utils.UIUtils"%>
<%@page import="ca.trader.utils.HttpConsts"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Trader project</title>	
        <jsp:include page="head.jsp" />
    </head>
    <body>
	<% if (UIUtils.wasUserAuthenticationSuccess(session))  {%>

		    <h2 style ="color: #C00">Welcome <%= session.getAttribute(HttpConsts.SESSION_ATTRIBUTE_AUTHENTICATED_USER_FIRST_NAME)%></h2>
		    <a href="<%= HttpConsts.LOGOUT_JSP_PAGE%>">Logout</a>
		    <br/>
		    <a href="<%= HttpConsts.SEARCH_SALES_JSP_PAGE%>">Search sales</a>
		    <br/>
		    <br/>
		    <a href="<%= HttpConsts.CREATE_SALE_JSP_PAGE%>">Create a sale</a>
		    <br/>
		    <a href="<%= HttpConsts.VIEW_USER_PROFILE_JSP_PAGE %>">View my profile</a>
		    <br/>
		    <a href="<%= HttpConsts.VIEW_USER_SALES_JSP_PAGE %>?page=1">View my sales</a>
		    <br/>
		    <a href="<%= HttpConsts.VIEW_FAVOURITED_SALES_JSP_PAGE %>?page=1">View favourited sales</a>
		    <br/>

	<% }else{%>
	<a href="<%= HttpConsts.LOGIN_JSP_PAGE %>">Login</a>
	<a href="<%= HttpConsts.REGISTER_JSP_PAGE %>">Register</a>
	<% }%>
    </body>
</html>
